const Base = require('../../base.js');

module.exports = class extends Base {
  async indexAction() {
    let data = this.get()

    let result = await this.model('task/index').list(data.page, data.num)
    let count = await this.model('task/index').count()
    data.count = count

    this.json({
      status: 200,
      message: 'success',
      data: {
        result, page: data
      }
    })
  }
};
